<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script type="text/javascript">
  function add(idx){
  var sf=document.getElementsByName("sf");
  var alist=sf[idx].airlist;
 // alert(alist.value);
 //alert(alist.options[alist.selectedIndex].text);  
  //alert(sf[0].flightId.value);
  var s=sf[idx].anames.value;
  if(s==null||s.trim().length==0){
  s+=alist.options[alist.selectedIndex].text;
  }else{
  s+=","+alist.options[alist.selectedIndex].text;
  }
  sf[idx].anames.value=s;
  }
  </script>
    <base href="<%=basePath%>">
    
    <title>My JSP 'flight_tran_edit.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <center><font size="8">航班中转管理</font></center>
  <table width="100%" border="1">
  <tr><td width="25%">航班id</td><td width="25%">中转机场</td><td width="50%">操作</td></tr>
  <s:iterator value="ftplist" status="st">
  <tr>
  <td colspan="3">
	<form action="flightaction!tranedit.action" method="post" name="sf">
	<table width="100%" border="1">
	<tr><td width="10%"><input type="text" id="fid" name="tvo.flightId" value="${flightId }"></td><td width="25%"><input type="text"  name="anames" value="${airportName }"></td><td width="25%"><s:select list="airportlist" listKey="airportId" listValue="airportName" id="airlist" theme="simple" value="takeOffAirport"/><a href="javascript:add('<s:property value="#st.index"/>');">添加</a><input type="submit" value="提交"></td></tr>
	</table>
	</form>  
  </td>
  </tr>
  </s:iterator>
  </table>
  </body>
</html>
